// 公告相关API接口
import request from '@/utils/request'
import type { PublishAnnouncementForm, AnnouncementQueryParams } from './type'

// 发布公告
export const reqPublishAnnouncement = (data: PublishAnnouncementForm) => {
  return request.post('/announcement/publish', data)
}

// 获取公告列表
export const reqGetAnnouncementList = (params: AnnouncementQueryParams) => {
  return request.get('/announcement/list', { params })
}

// 获取公告详情
export const reqGetAnnouncementDetail = (id: number) => {
  return request.get(`/announcement/detail/${id}`)
}

// 删除公告
export const reqDeleteAnnouncement = (id: number) => {
  return request.delete(`/announcement/delete/${id}`)
}

